@extends('layouts.app', ['activePage' => 'extended', 'menuParent' => 'contato', 'titlePage' => __('Listar Contatos')])

@section('content')
    <div class="content">
        <div class="container-fluid">
            <div class="row">
                <div class="col-md-12">
                    <div class="card">
                        <div class="card-header card-header-rose card-header-icon">
                            <div class="card-icon">
                                <i class="material-icons">assignment</i>
                            </div>
                            <h4 class="card-title">Listar Contatos</h4>
                        </div>
                        <div class="card-body">
                            <div class="table-responsive">
                                <table class="table">
                                    <thead>
                                    <tr>
                                        <th class="text-center">#</th>
                                        <th>Mensagem</th>
                                        <th>Email</th>
                                        <th>Nome</th>
                                        <th>Data</th>
                                        <th class="text-right">Visivel</th>
                                        <th class="text-right">Ações</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    @foreach($data as $item)
                                        <tr>
                                            <td class="text-center">{{$item->id}}</td>
                                            <td class="">{{\Illuminate\Support\Str::limit($item->getbody(),100)}}</td>
                                            <td>{{$item->email}}</td>
                                            <td>{{$item->name}}</td>
                                            <td>{{date_format($item->created_at,'d/m/Y')}}</td>
                                            <td class="text-right">{{$item->visible}}</td>
                                            <td class="td-actions text-right">
                                                <a type="button" rel="tooltip" class="btn btn-info" target="_blank"
                                                   href="{{route('dash.contato.read',$item->id)}}">
                                                    <i class="material-icons">person</i>
                                                </a>
                                            </td>
                                        </tr>
                                    @endforeach
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection

@push('js')
    <script>
        {{-- $(document).ready(function () {
            // Javascript method's body can be found in assets/js/demos.js
           // demo.initGoogleMaps();
        });--}}
    </script>
@endpush